import com.kuang.dao.UserDao;
import com.kuang.pojo.User;
import com.kuang.service.UserService;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class test {
    @Test
    public void test(){
       ApplicationContext context = new ClassPathXmlApplicationContext("application.xml");
        Object userController1 = context.getBean("users");
        System.out.println("userController1 = " + userController1);


        Object userController2 = context.getBean("users");
        System.out.println("userController2 = " + userController2);

    }
/**
 * 测试内容:
 */
@Test
public void test02(){
    ApplicationContext context = new ClassPathXmlApplicationContext("application.xml");
   UserService userService = context.getBean("userService",UserService.class);
    System.out.println(userService.name);
   /* UserDao userDao = context.getBean("userDao", UserDao.class);
    System.out.println(userDao.name);*/
}
}
